package com.hotel.controller;

import com.hotel.common.AjaxResult;
import com.hotel.domain.service.SystemInfoService;
import com.hotel.pojo.SystemInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/systemInfo")
public class SystemInfoController {

    @Autowired
    private SystemInfoService systemInfoService;

    /**
     * 获取系统信息
     * @return AjaxResult
     */
    @GetMapping("/getSystemInfo")
    @ResponseBody
    public AjaxResult getSystemInfo(){
        return AjaxResult.queryAjax(systemInfoService.getSystemInfo());
    }

    /**
     * 更新系统信息
     * @param systemInfo 系统信息对象
     * @return AjaxResult
     */
    @PostMapping("/update")
    @ResponseBody
    public AjaxResult updateSystemInfo(@RequestBody  SystemInfo systemInfo){
        return AjaxResult.updateAjax(systemInfoService.updateSystemInfo(systemInfo));
    }

}
